<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>The x86 Script Instruction Virtual Machine</title>
    <meta name="description" content="IntroductionThis is a very simple and lightweight x86 virtual machine which can load and run the assembly code from ida pro directly.Features  Supports cross...">

    
    <meta name="keywords" content="xmake,x86,script,assembly,virtual,machine,idapro,tboox" /> 

    <!-- qq oauth -->
    <meta property="qc:admins" content="5211601217706727767255" />

    <!--icon -->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" sizes="192x192" href="/static/img/nice-highres.png" />
	<link rel="apple-touch-icon-precomposed" href="/static/img/apple-touch-icon-57x57-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/img/apple-touch-icon-72x72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/img/apple-touch-icon-114x114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/img/apple-touch-icon-144x144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/static/img/retinahd_icon.png" />
	<meta name="msapplication-TileImage" content="/static/img/retinahd_icon.png" />
	
    <link rel="stylesheet" href=" /css/fontawesome/css/font-awesome.min.css ">
    <link rel="stylesheet" href=" /css/main.css ">
    <link rel="canonical" href="https://tboox.org/2016/07/26/x86-script-instruction-virtual-machine/">
    <link rel="alternate" type="application/rss+xml" title="TBOOX Open Source Project" href="https://tboox.org/feed.xml ">
    <link rel="alternate" hreflang="en" href="https://tboox.org/" />
    <link rel="alternate" hreflang="zh-Hans" href="https://tboox.org/cn/" />




    <script type="text/javascript">
    function isPC(){    
        var userAgentInfo = navigator.userAgent;  
        var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
        var flag = true;    
        for (var v = 0; v < Agents.length; v++) {    
            if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
        }    
        return flag;    
    }
    </script>

<!-- baidu ads -->



    <!-- baidu ads -->

</head>


  <body>

    <header id="top">
    <div class="wrapper">
        <a href="/" class="brand">TBOOX</a>
        <button id="headerMenu" class="menu"><i class="fa fa-bars"></i></button>
        <nav id="headerNav">
            <ul>
                <li>
                    
                    <a href="/cn?lang=0">
                    
                        <i class="fa fa-home"></i>中文
                    </a>
                </li>

                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/project/">
                            
                        
                            <i class="fa fa-bookmark"></i>Projects
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/archive/">
                            
                        
                            <i class="fa fa-archive"></i>Archives
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/category/">
                            
                        
                            <i class="fa fa-th-list"></i>Categories
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/tag/">
                            
                        
                            <i class="fa fa-tags"></i>Tags
                        </a>
                    </li>
                    
                    
                    
                
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/docs/">
                            
                        
                            <i class="fa fa-book"></i>Documents
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="https://xmake.io/#/about/contact" target="_blank" >
                            
                        
                            <i class="fa fa-forumbee"></i>Community
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/donation/">
                            
                        
                            <i class="fa fa-heart"></i>Donate
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/about/">
                            
                        
                            <i class="fa fa-user"></i>About
                        </a>
                    </li>
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                     
                     
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            </ul>
        </nav>
    </div>
</header>



        <div class="page clearfix" post>
    <div class="left">
        <h1>The x86 Script Instruction Virtual Machine</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>2016-07-26
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
            


<!-- <span class="point">•</span> -->
<span class="categories">
  <i class="fa fa-th-list"></i>
  
    
        <a href="/category/#vm86" title="Category: vm86" rel="category">vm86</a>
    
  

  <!-- <span class="point">•</span> -->
</span>


            </div>

            <div class="label-card">
            
<!-- <span class="point">•</span> -->
<span class="pageTag">
  <i class="fa fa-tags"></i>
  
    
        <!--a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a-->
        <a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a>&nbsp;
    
        <!--a href="/tag/#x86" title="Tag: x86" rel="tag">x86</a-->
        <a href="/tag/#x86" title="Tag: x86" rel="tag">x86</a>&nbsp;
    
        <!--a href="/tag/#script" title="Tag: script" rel="tag">script</a-->
        <a href="/tag/#script" title="Tag: script" rel="tag">script</a>&nbsp;
    
        <!--a href="/tag/#assembly" title="Tag: assembly" rel="tag">assembly</a-->
        <a href="/tag/#assembly" title="Tag: assembly" rel="tag">assembly</a>&nbsp;
    
        <!--a href="/tag/#virtual" title="Tag: virtual" rel="tag">virtual</a-->
        <a href="/tag/#virtual" title="Tag: virtual" rel="tag">virtual</a>&nbsp;
    
        <!--a href="/tag/#machine" title="Tag: machine" rel="tag">machine</a-->
        <a href="/tag/#machine" title="Tag: machine" rel="tag">machine</a>&nbsp;
    
        <!--a href="/tag/#idapro" title="Tag: idapro" rel="tag">idapro</a-->
        <a href="/tag/#idapro" title="Tag: idapro" rel="tag">idapro</a>
    
  

</span>

            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        <h2 id="introduction">Introduction</h2>

<p>This is a very simple and lightweight x86 virtual machine which can load and run the assembly code from ida pro directly.</p>

<h2 id="features">Features</h2>

<ul>
  <li>Supports cross-platform and it’s able to run the x86 assembly code on linux, windows, maxosx, android and ios …</li>
  <li>Supports the frequently-used x86 assembly instruction (.e.g logical operations, goto, loop, call, stack operations …)</li>
  <li>Supports call the third-party library interfaces. (.e.g libc ..)</li>
  <li>We can pass arguments and get the return results after running.</li>
  <li>Supports thread-safe.</li>
  <li>Does not support arm64 and only for 32-bits architecture</li>
</ul>

<h2 id="example">Example</h2>

<p>We get one assemble code from ida pro first and this code will call the libc api: <code class="highlighter-rouge">printf</code></p>

<div class="highlighter-rouge"><pre class="highlight"><code>sub_hello	proc near 
arg_0		= dword	ptr  8 
.data 
        format db \"hello: %x\", 0ah, 0dh, 0 
 
off_5A74B0	dd offset loc_6B2B50	; DATA XREF: sub_589100+1832 
		dd offset loc_58A945	; jump table for switch	statement 
 
.code 
        ; hi
        push	ebp ;hello 
		mov	ebp, esp 
 
    loc_6B2B50:				; CODE XREF: sub_6B2B40+8
        push    eax 
		mov	eax, [ebp+arg_0] 
        push eax 
        mov eax, offset format 
        push eax 
        call printf 
        add esp, 4 
        pop eax 
        
        mov ecx, 1
        jmp ds:off_5A74B0[ecx*4]
 
loc_58A945:
        push    eax 
		mov	eax, [ebp+arg_0] 
        push eax 
        mov eax, offset format 
        push eax 
        call printf 
        add esp, 4 
        pop eax 
        
  end:
        mov	esp, ebp 
		pop	ebp 
        retn 
sub_hello    endp 
</code></pre>
</div>

<p>And we call it in c language first.</p>

<div class="language-c highlighter-rouge"><pre class="highlight"><code><span class="n">sub_hello</span><span class="p">(</span><span class="mi">31415926</span><span class="p">);</span>
</code></pre>
</div>

<p>The output results:</p>

<div class="highlighter-rouge"><pre class="highlight"><code>hello: 31415926
hello: 31415926
</code></pre>
</div>

<p>Nextly, we attempt to load this asm code using our x86 virtual machine.</p>

<div class="language-c highlighter-rouge"><pre class="highlight"><code><span class="k">static</span> <span class="n">tb_void_t</span> <span class="nf">vm86_demo_proc_exec_hello</span><span class="p">(</span><span class="n">tb_uint32_t</span> <span class="n">value</span><span class="p">)</span>
<span class="p">{</span>
    <span class="c1">// the code
</span>    <span class="k">static</span> <span class="n">tb_char_t</span> <span class="k">const</span> <span class="n">s_code_sub_hello</span><span class="p">[]</span> <span class="o">=</span> 
    <span class="p">{</span>
<span class="s">"sub_hello	proc near </span><span class="se">\n</span><span class="s">\
arg_0		= dword	ptr  8 </span><span class="se">\n</span><span class="s">\
.data </span><span class="se">\n</span><span class="s">\
        format db </span><span class="se">\"</span><span class="s">hello: %x</span><span class="se">\"</span><span class="s">, 0ah, 0dh, 0 </span><span class="se">\n</span><span class="s">\
 </span><span class="se">\n</span><span class="s">\
off_5A74B0	dd offset loc_6B2B50	; DATA XREF: sub_589100+1832 </span><span class="se">\n</span><span class="s">\
		dd offset loc_58A945	; jump table for switch	statement </span><span class="se">\n</span><span class="s">\
 </span><span class="se">\n</span><span class="s">\
.code </span><span class="se">\n</span><span class="s">\
        ; hi</span><span class="se">\n</span><span class="s">\
        push	ebp ;hello </span><span class="se">\n</span><span class="s">\
		mov	ebp, esp </span><span class="se">\n</span><span class="s">\
 </span><span class="se">\n</span><span class="s">\
    loc_6B2B50:				; CODE XREF: sub_6B2B40+8</span><span class="se">\n</span><span class="s">\
        push    eax </span><span class="se">\n</span><span class="s">\
		mov	eax, [ebp+arg_0] </span><span class="se">\n</span><span class="s">\
        push eax </span><span class="se">\n</span><span class="s">\
        mov eax, offset format </span><span class="se">\n</span><span class="s">\
        push eax </span><span class="se">\n</span><span class="s">\
        call printf </span><span class="se">\n</span><span class="s">\
        add esp, 4 </span><span class="se">\n</span><span class="s">\
        pop eax </span><span class="se">\n</span><span class="s">\
        </span><span class="se">\n</span><span class="s">\
        mov ecx, 1</span><span class="se">\n</span><span class="s">\
        jmp ds:off_5A74B0[ecx*4]</span><span class="se">\n</span><span class="s">\
 </span><span class="se">\n</span><span class="s">\
loc_58A945:</span><span class="se">\n</span><span class="s">\
        push    eax </span><span class="se">\n</span><span class="s">\
		mov	eax, [ebp+arg_0] </span><span class="se">\n</span><span class="s">\
        push eax </span><span class="se">\n</span><span class="s">\
        mov eax, offset format </span><span class="se">\n</span><span class="s">\
        push eax </span><span class="se">\n</span><span class="s">\
        call printf </span><span class="se">\n</span><span class="s">\
        add esp, 4 </span><span class="se">\n</span><span class="s">\
        pop eax </span><span class="se">\n</span><span class="s">\
        </span><span class="se">\n</span><span class="s">\
  end:</span><span class="se">\n</span><span class="s">\
        mov	esp, ebp </span><span class="se">\n</span><span class="s">\
		pop	ebp </span><span class="se">\n</span><span class="s">\
        retn </span><span class="se">\n</span><span class="s">\
sub_hello    endp </span><span class="se">\n</span><span class="s">\
    "</span>
    <span class="p">};</span>

    <span class="c1">// the machine
</span>    <span class="n">vm86_machine_ref_t</span> <span class="n">machine</span> <span class="o">=</span> <span class="n">vm86_machine</span><span class="p">();</span>
    <span class="k">if</span> <span class="p">(</span><span class="n">machine</span><span class="p">)</span>
    <span class="p">{</span>
        <span class="c1">// the lock
</span>        <span class="n">tb_spinlock_ref_t</span> <span class="n">lock</span> <span class="o">=</span> <span class="n">vm86_machine_lock</span><span class="p">(</span><span class="n">machine</span><span class="p">);</span>

        <span class="c1">// enter
</span>        <span class="n">tb_spinlock_enter</span><span class="p">(</span><span class="n">lock</span><span class="p">);</span>

        <span class="c1">// the stack
</span>        <span class="n">vm86_stack_ref_t</span> <span class="n">stack</span> <span class="o">=</span> <span class="n">vm86_machine_stack</span><span class="p">(</span><span class="n">machine</span><span class="p">);</span>

        <span class="c1">// compile proc
</span>        <span class="n">vm86_proc_ref_t</span> <span class="n">proc</span> <span class="o">=</span> <span class="n">vm86_text_compile</span><span class="p">(</span><span class="n">vm86_machine_text</span><span class="p">(</span><span class="n">machine</span><span class="p">),</span> <span class="n">s_code_sub_hello</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">s_code_sub_hello</span><span class="p">));</span>
        <span class="k">if</span> <span class="p">(</span><span class="n">proc</span><span class="p">)</span>
        <span class="p">{</span>
            <span class="c1">// add function
</span>            <span class="n">vm86_machine_function_set</span><span class="p">(</span><span class="n">machine</span><span class="p">,</span> <span class="s">"printf"</span><span class="p">,</span> <span class="n">vm86_demo_proc_func_printf</span><span class="p">);</span>

            <span class="c1">// init arguments
</span>            <span class="n">vm86_stack_push</span><span class="p">(</span><span class="n">stack</span><span class="p">,</span> <span class="n">value</span><span class="p">);</span>

            <span class="c1">// done proc
</span>            <span class="n">vm86_proc_done</span><span class="p">(</span><span class="n">proc</span><span class="p">);</span>

            <span class="c1">// restore stack
</span>            <span class="n">vm86_stack_pop</span><span class="p">(</span><span class="n">stack</span><span class="p">,</span> <span class="n">tb_null</span><span class="p">);</span>

            <span class="c1">// trace
</span>            <span class="n">tb_trace_i</span><span class="p">(</span><span class="s">"sub_hello(%x)"</span><span class="p">,</span> <span class="n">value</span><span class="p">);</span>
        <span class="p">}</span>

        <span class="c1">// leave
</span>        <span class="n">tb_spinlock_leave</span><span class="p">(</span><span class="n">lock</span><span class="p">);</span>
    <span class="p">}</span> 
<span class="p">}</span>

<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span><span class="o">**</span> <span class="n">argv</span><span class="p">)</span>
<span class="p">{</span>
    <span class="c1">// call this function: sub_hello(0x31415926)
</span>    <span class="n">vm86_demo_proc_exec_hello</span><span class="p">(</span><span class="mh">0x31415926</span><span class="p">);</span>    
<span class="p">}</span>
</code></pre>
</div>

<p>The output results:</p>

<div class="highlighter-rouge"><pre class="highlight"><code>hello: 31415926
hello: 31415926
</code></pre>
</div>

<h2 id="source-code">Source code</h2>

<ul>
  <li><a href="https://github.com/waruqi/vm86">Github</a></li>
  <li><a href="/project/">More projects</a></li>
</ul>

<h2 id="compilation">Compilation</h2>

<p>Please install <a href="http://www.xmake.io">xmake</a> first!</p>

<h3 id="compile-project-on-macosx">Compile project on macosx</h3>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo brew install xmake
<span class="gp">$ </span>xmake f -a i386
<span class="gp">$ </span>xmake
</code></pre>
</div>

<h3 id="compile-project-on-linux">Compile project on linux</h3>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>git clone https://github.com/waruqi/xmake.git
<span class="gp">$ </span><span class="nb">cd </span>xmake
<span class="gp">$ </span>sudo ./install
<span class="err">$</span>
<span class="gp">$ </span><span class="nb">cd </span>vm86
<span class="gp">$ </span>xmake f -a i386
<span class="gp">$ </span>xmake
</code></pre>
</div>

<h3 id="compile-project-on-windows">Compile project on windows</h3>

<p>Downloads https://github.com/waruqi/xmake/archive/master.zip first.</p>

<p>Extracts it and run install.bat</p>

<p>Lastly, we start compiling vm86 project.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake
</code></pre>
</div>

<h3 id="compile-project-for-android">Compile project for android</h3>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span><span class="nb">cd </span>vm86
<span class="gp">$ </span>xmake f -p android --ndk<span class="o">=</span>/xxx/ndk
<span class="gp">$ </span>xmake
</code></pre>
</div>

<h2 id="running">Running</h2>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake r demo
</code></pre>
</div>

<h2 id="ida-scripts">Ida scripts</h2>

<p>The script files: <code class="highlighter-rouge">export_function.idc</code> and <code class="highlighter-rouge">export_data.idc</code> in the project directory (idc) 
can help us to export the given assembly function and data from the ida pro.</p>


        </article>
        <hr>

        <!-- baidu ads -->
        

        
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
                    
                    <h2 id="chinese">中文</h2>
                    <ul>
                    
                    <li class="relatedPost">
                        <a href="/cn/2016/07/26/x86-script-instruction-virtual-machine/">x86汇编指令脚本虚拟机
                        
                        </a>
                    </li>
                    
                    
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
        
            </ul>
        

        
        
            
            
            
                
                    
                        
                        <h2 id="similar_posts">Similar Posts</h2>
                        <ul>
                        
                        <li class="relatedPost">
                            <a href="/2021/12/17/xmake-update-v2.6.2/">Xmake v2.6.2 released, Support building Linux kernel driver module
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/12/03/xmake-update-v2.6.1/">xmake v2.6.1 released, Switch to Lua5.4 runtime, Support Rust and C++ mixed compilation
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 released, Improve C++20 Modules and support Nim, Keil MDK and Unity Build
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/10/08/xmake-update-v2.5.8/">xmake v2.5.8 is released, Support Pascal/Swig program and Lua53 runtime
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 released, Use lockfile to freeze package dependencies and Vala/Metal language support
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
        
            </ul>
        

        <div class="post-recent">
    <div class="pre">

        

        

        
        
        

        

        

        
        
        <p><strong>Prev Post</strong> <a href="/2016/07/25/support-debugger-on-windows/">Running and debugging program using xmake</a></p>
        
    </div>

    <div class="nex">

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        <p><strong>Next Post</strong> <a href="/2016/08/24/forum-opened/">TBOOX Open Source Community Established</a></p>
        
    </div>
</div>


        <h2 id="comments">Comments</h2>
        






<div id="gitalk-container"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>

<script>
const gitalk = new Gitalk({
  clientID: '73946dc1d9e2276ad0da',
  clientSecret: '12a3cb94361ba3ebc6ecb68cf80d592bfaa8106d',
  repo: 'tboox.github.io',
  owner: 'waruqi',
  admin: ['waruqi'],
  id: location.pathname,      
  language: 'en',
  distractionFreeMode: false  
})

gitalk.render('gitalk-container')
</script>





    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">


            <!-- codefund ads -->
            

            <!-- Content -->
            <div class="side content">
                <div>
                    Content
                </div>
                <ul id="content-side" class="content-ul">
                    <li><a href="#chinese">中文</a></li>
                    <li><a href="#similar_posts">Similar Posts</a></li>
                    <li><a href="#comments">Comments</a></li>
                </ul>
            </div>

            <!-- baidu ads -->
            

            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    Links
                </div>
                <ul class="content-ul">
                  <li><a href="http://github.com/waruqi/tbox">tbox</a></li>
                  <li><a href="http://www.xmake.io">xmake</a></li>
                  <li><a href="https://github.com/waruqi">github</a></li>
                </ul>
            </div> 

            <!-- google ads -->
            

            <!-- baidu ads -->
            

            <!-- chitika ads -->
            
        </div>
    </div>

    <!-- baidu ads -->
    
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="/js/pageContent.js " charset="utf-8"></script>



    <footer class="site-footer">
    <div class="wrapper">
        <p class="description">
             Copyright (c) 2016-2020 tboox.org 
        </p>
        <p class="contact">
            
            <a href="https://github.com/waruqi" title="GitHub"><i class="fa fa-github" aria-hidden="true"></i></a> 
             
            
            <a href="mailto:waruqi@gmail.com" title="email"><i class="fa fa-envelope-o" aria-hidden="true"></i></a> 
            
            
            <a href="https://twitter.com/waruqi" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> 
            
            <a href="/feed.xml" title="feed"><i class="fa fa-feed" aria-hidden="true"></i></a> 
        </p>
        <p class="power">
            <span>
                Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/Gaohaoyang">HyG</a> & <a href="https://pages.github.com/">Github Pages</a>.
            </span>
        </p>
    </div>
</footer>

    <div class="back-to-top">
    <a href="#top" class="scroll">
        <i class="fa fa-arrow-up" aria-hidden="true"></i>
    </a>
</div>

    <script src=" /js/main.js " charset="utf-8"></script>
    <script src=" /js/scroll.min.js " charset="utf-8"></script>
  </body>

</html>
